#ifndef CREATEMODE_H
#define CREATEMODE_H

#include <QWidget>
#include <phonon>

#include "SeriovyPort.h"

#include <QGraphicsScene>
#include <QFileDialog>

#include "mygraphicsscene.h"
#include "mygraphicsitem.h"
#include "mylistwidget.h"
#include "mylistwidgetitem.h"


namespace Ui {
class CreateMode;
}

class CreateMode : public QWidget
{
    Q_OBJECT


public:
    explicit CreateMode(QWidget *parent = 0);
    ~CreateMode();
    void setPort(QtSeriovyPort *port);
    
private:
    Ui::CreateMode *ui;
    QtSeriovyPort *port;

    QString soundName;
    QString trackName;

    Phonon::MediaObject *mediaObject;
    Phonon::AudioOutput *audioOutput;
    Phonon::Path *path;

    Phonon::VolumeSlider *volumeSlider;
    Phonon::SeekSlider *seekSlider;

    MyGraphicsScene *scene;

    MyListWidget *listWidget;

public slots:
    void play();
    void stop();
    void pause();
    void newPalayerState(Phonon::State newstate, Phonon::State oldstate);
    void loadSong();
    void loadTrack();

protected slots:
    void processPressedItem(MyGraphicsItem* item);
    void finished();
    void changeAudioDevice();
    void tiknuti(qint64 h);
    void totalTimeChanged(qint64);
};

#endif // CREATEMODE_H
